package redisdemo.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import redisdemo.annotation.RedisCache;
import redisdemo.mapper.AdressMapper;
import redisdemo.po.AdressPO;
import redisdemo.service.DemoService;

import java.util.List;
@Service
public class DemoServiceImpl implements DemoService {
    @Autowired
    private AdressMapper adressMapper;
    @Override
    @RedisCache(className = "redisdemo.po.AdressPO", fieldName = "cityCode")
    public List<AdressPO> find(AdressPO adressPO) {
        return adressMapper.find(Long.valueOf(adressPO.getCityCode()).intValue());
    }
}
